#ifndef PLAYBACKVOLUMEBUTTON_H
#define PLAYBACKVOLUMEBUTTON_H

#include "playbackvolumedialog.h"

#include <QPushButton>

class PlaybackVolumeButton : public QPushButton
{
    Q_OBJECT
public:
    explicit PlaybackVolumeButton(QWidget *parent = nullptr);
    ~PlaybackVolumeButton();

    //void setVLC(VLCKits *vlcKits);

signals:
    void volume(int value);
private slots:
    //音量按钮被按下时槽函数
    void clickSlot() ;

protected:
    void paintEvent(QPaintEvent* event) override;
    void enterEvent(QEvent* event) override;
    //void leaveEvent(QEvent *event) override;
    //重写定时器函数
    void timerEvent(QTimerEvent* event) override;
private:
    void hide();
    int timerId = 0;//定时器id
    bool isRunning = false;//定时器开启的标志位
    bool isMute = false;//是否静音
    int  volumeValue = 0;//音量值

private:
    PlaybackVolumeDialog * volumeSliderDlg;

    //VLCKits *_vlcKits;

    bool isconnect = true;
};

#endif // PLAYBACKVOLUMEBUTTON_H
